package com.hundsun.yr.universal.p2p.bean.enums;

import java.util.ArrayList;
import java.util.HashMap;

import com.hundsun.yr.universal.p2p.bean.enums.base.Enum;
import com.hundsun.yr.universal.p2p.bean.enums.base.LabelEnum;

/**
 * 学历枚举类
 * 
 * @author tonglj
 * 
 */
public class EducationEnum extends LabelEnum {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static EducationEnum POSTGRADUATE_AND_UP = new EducationEnum("POSTGRADUATE_AND_UP", "研究生及以上");
	public static EducationEnum UNDERGRADUATE = new EducationEnum("UNDERGRADUATE", "本科");
	public static EducationEnum JUNIOR_COLLEGE_EDUCATION = new EducationEnum("JUNIOR_COLLEGE_EDUCATION", "专科");
	public static EducationEnum HIGH_SCHOOL = new EducationEnum("HIGH_SCHOOL", "高中");
	public static EducationEnum MIDDLE_SCHOOL_AND_DOWN = new EducationEnum("MIDDLE_SCHOOL_AND_DOWN", "初中及以下");

	private static HashMap<String, String> mHashMap = new HashMap<String, String>();

	protected EducationEnum(String name, String lable) {
		super(name, lable, "education");
		title = "学历";
	}

	@SuppressWarnings("unchecked")
	public static ArrayList<LabelEnum> getList() {
		mList.clear();
		mList.addAll(Enum.getEnumList(EducationEnum.class));
		return mList;
	}

	public static HashMap<String, String> getHashMap() {
		if (mHashMap == null || mHashMap.size() == 0) { // 保证mHashMap只进行一次赋值，只遍历一次mList
			ArrayList<LabelEnum> list = getList();
			for (LabelEnum labelEnum : list) {
				mHashMap.put(labelEnum.getName(), labelEnum.getLable());
			}
		}
		return mHashMap;
	}

}
